/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						script_hero_numeric_expression.h

	$Header: /heroes4/script_hero_numeric_expression.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_HERO_NUMERIC_EXPRESSION_H_INCLUDED )
#define SCRIPT_HERO_NUMERIC_EXPRESSION_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "script_expression_type.h"
#include "script_target_type.h"
#include "script_targeted_expression.h"

enum t_skill_type;

// --------------------------------------------------------------------------
// t_script_hero_numeric_expression class
// --------------------------------------------------------------------------

class t_script_hero_numeric_expression
	:	public t_script_targeted_numeric_expression< t_script_hero_target >
{
};

// --------------------------------------------------------------------------
// t_script_hero_experience_level class
// --------------------------------------------------------------------------

class t_script_hero_experience_level
	:	public t_script_hero_numeric_expression
{
public:
	// Member functions
	virtual t_result	evaluate(t_expression_context_hero const& context) const;
	virtual t_result	evaluate(t_expression_context_town const& context) const;
	virtual t_result	evaluate(t_expression_context_object const& context) const;
	virtual t_result	evaluate(t_expression_context_army const& context) const;
	virtual t_result	evaluate(t_expression_context_global const& context) const;
};

SPECIALIZE_SCRIPT_NUMERIC_EXPRESSION( k_script_numeric_hero_experience_level, t_script_hero_experience_level );

// --------------------------------------------------------------------------
// t_script_hero_skill_mastery class
// --------------------------------------------------------------------------

class t_script_hero_skill_mastery
	:	public t_script_hero_numeric_expression
{
public:
	// Constructor
	t_script_hero_skill_mastery();

	// Member functions
	virtual t_result	evaluate(t_expression_context_hero const& context) const;
	virtual t_result	evaluate(t_expression_context_town const& context) const;
	virtual t_result	evaluate(t_expression_context_object const& context) const;
	virtual t_result	evaluate(t_expression_context_army const& context) const;
	virtual t_result	evaluate(t_expression_context_global const& context) const;

	t_skill_type		get_skill_type() const;
	virtual bool		read( std::streambuf& stream, int version );
	virtual bool		read_from_map( std::streambuf & stream, int format_version );
	virtual bool		write( std::streambuf& stream ) const;

private:
	// Data members
	t_skill_type	m_skill_type;
};

// --------------------------------------------------------------------------
// t_script_hero_skill_mastery inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_script_hero_skill_mastery::t_script_hero_skill_mastery()
	:	m_skill_type( t_skill_type( 0 ) )
{
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_skill_type t_script_hero_skill_mastery::get_skill_type() const
{
	return m_skill_type;
}

SPECIALIZE_SCRIPT_NUMERIC_EXPRESSION( k_script_numeric_hero_skill_mastery, t_script_hero_skill_mastery );

#endif // !defined( SCRIPT_HERO_NUMERIC_EXPRESSION_H_INCLUDED )
